There are a number of well-known techniques for the transformation of images. Among these techniques are non-linear image transforms, such as dynamic range compression image transforms. Dynamic range is the ratio of intensities of the brightest and darkest recordable parts of an image or scene. A dark area of an image (for example, a shadow) has low image intensity, while a lighter area (for example, a white cloud) has high image intensity. Electronic optical equipment, based on CCD detector arrays, can acquire image data incorporating a large dynamic range, for example in the order of 2500:1. However, this range can be lost when the image is digitized, either due to use of a lossy compression algorithm (e.g. JPEG, MPEG) or when the image is rendered on a medium having a narrow dynamic range (e.g. printed hard copy, displayed on a display device.)
Consequently, it can be desirable to compress the dynamic range of an image to give, it a more ‘natural’ appearance. Examples of dynamic range compression image transforms include Retinex, local histogram equalization, and gamma correction. A further example is the ORMIT algorithm, disclosed in patent application WO 02/089060, of which the contents are incorporated herein in full by reference, and which will be referred to in more detail below.
The transform processes described above may result in the reduction of local contrast. Local contrast may be defined as a ratio of intensities of neighbouring pixels of an image (or otherwise resolvable areas in the case of continuous image):
                              L          ⁢                                          ⁢          C                ≡                                                                        I                1                            -                              I                2                                                                                    I              1                        +                          I              2                                                          (        1        )            where I1 and I2 are intensities in two neighbouring pixels.
As an image is transformed using a non-linear image transform, the difference in image intensity between neighbouring pixels may be lost. FIG. 1 shows an example of a dynamic range compression image transform decreasing the local contrast. The example transform is the standard image conditioning technique known as “gamma-correction”, in which a transfer curve such as that shown in part (b) is applied to vary the input intensity (a) to produce an output intensity (c) in the image. As a result of this transform, small details in bright parts of the image become less distinguishable. This can be seen in the loss of definition in the dip in the intensity curves shown in a) the input image and c) the output image.
A similar effect is illustrated in FIG. 2, in the case of a 3×3 pixel image. As can be seen, the local contrast between a relatively dark pixel and a set of relatively light pixels around it is reduced, in this example, from ⅓ to 1/10, between the input image and the output image.
Another kind of distortion caused by tonal mapping procedures (aiming to increase the brightness of the dark parts of a scene) such as gamma-correction may be termed “shape distortion”. FIG. 3 shows an example of the shape distortion resulting from the exemplary tonal mapping. Namely, bright features can appear to increase in width. This can be seen in the increased width at the half maximum intensity of the intensity peak seen in a) the input image and c) the output image.
Local contrast in an image can be increased using known image processing techniques such as image sharpening transforms. However, if an image processed with a dynamic range compression image transform is subsequently processed using an image sharpening transform, there is little correspondence between the loss of local contrast in the initial transform and the increase of local contrast using the image sharpening transform. Hence, the resulting image tends to look less natural.
In accordance with one aspect of the present invention, there is provided a method of image processing comprising altering an input image using a non-linear image transform to generate an output image, the process comprising transforming an image on an area-by-area basis to generate an output image intensity (Oij) of an area which is different to an input image intensity (Iij) of the area, the output image intensity (Oij) of an area being related to the input image intensity (Iij) of the area by the ratio:amplification coefficient=Oij/Iij  (2)
wherein the image processing method produces an output image in which the amplification coefficient of a given area is varied in dependence upon the amplification coefficient of at least one neighbouring area, in order that that, in at least part of the image, the local contrast of the input image is at least partially preserved in the output image.
The present invention provides a method that at least partially preserves, that is to say reduces the deterioration of, local contrast in images being processed using a non-linear image transform.
Preferably, as a result of local contrast preservation during the image transform, the local contrast in at least some parts of the output image and the local contrast of the corresponding parts of the input image are not significantly different:I1/I2≈O1/O2 
where I1 and I2 are image intensities of two immediately neighbouring areas in a relevant part of the input image, and O1 and O2 are the image intensities of the same two areas of the output image.
The invention provides a method in which the local contrast is at least partially preserved in at least part of an image. By parts, we mean regions having large numbers of image areas, e.g. pixels, having different intensity values. Such regions may, for example, include hundreds of pixels. Since loss of local contrast is more visible in relatively light parts of an image, local contrast is preferably preserved in at least those parts of an image in which the average input intensity is relatively light. With parts of an image where the average input intensity is relatively dark, it may be acceptable to allow significant loss of contrast, since the contrast will not in any case be discernable to the viewer, and hence the natural look of an image can still be preserved. Hence, the invention includes local contrast preservation methods in which local contrast is preserved more in relatively light parts of an image relative to relatively dark parts of an image.
According to a further aspect of the present invention there is provided a method of image processing comprising altering an input image using a non-linear image transform to generate an output image, the transform being arranged to correct an image on an area-by-area basis to generate an output image (O) of an area which is different to an input image (I), the output image omage (O) being related to the input image (I) of the area by the transform:O=ƒ(I)
the transform generating an output image intensity (Oij) of an area which is different to an input image intensity (Iij) of the area, the output image intensity (Oij) of an area being related to the input image intensity (Iij) of the area by the ratio:amplification coefficient=Oij/Iij 
wherein the method comprises varying the amplification coefficient of a given area in dependence upon the amplification coefficient of at least one neighbouring area, in order that that, in at least part of the image, the local contrast of the output image is not significantly different to the local contrast of the input image:I1/I2≈O1/O2 
where I1 and I2 are image intensities of two immediately neighbouring areas of the input image, and O1 and O2 are the image intensities of the same two areas of the output image.
Embodiments of the present invention may be implemented in digital or analogue formats. Where the image to be processed is digital, the areas are represented by pixels. Where the image to be processed is in analogue format, the areas should be taken to be small areas of the image of a preset size, i.e. pixel-like areas.
The method of the invention may be implemented in computer software or in hardware. An exemplary implementation may take the form of a monolithic analogue integrated circuit (IC), which has the advantages of small size and low power consumption, which are desirable features in image capture devices. In image capture devices such as handheld video cameras and security cameras, small size and low power consumption are particularly desirable.
The image capture device may capture an image as an analogue image. Images captured in an analogue format may be converted to a digital format by an analogue-digital converter (ADC.) Methods in accordance with the invention may be applied either before such digitization or after such digitization.
Methods in accordance with the invention may be applied to both colour and greyscale images. In the case of colour images, the method could be used to modify the image intensity of the image, leaving hue and saturation unchanged, or the method could be used to modify individual colour channels, providing colour correction.
Embodiments of the invention may be implemented in any system in which a non-linear image transform such as dynamic range compression is employed. As such, possible implementations of the present invention include software for digital still images (stand-alone, scanner software, printer software) and video improvement; digital still and video cameras; cathode ray tube (CRT) displays; liquid crystal device (LCD) displays; image projectors; other types of display apparatus; and printers. Implementations in the analogue domain include analogue video cameras; super-fast video cameras; high quality digital video cameras; security cameras; X-ray and night-vision enhancement equipment.
The invention may be used in various image processing methods, including hazy scene enhancement; multiple exposure based image synthesis for large dynamic range scenes; advanced colour correction procedures; and universal image improvement for televisions, computer monitors, and other displays.
Further features and advantages of the invention will become apparent from the following description of preferred embodiments of the invention, given by way of example only, which is made with reference to the accompanying drawings.